BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.IC_SDJL ADD
	FClient varchar(50) NULL,
	UserName varchar(50) NULL,
	Address varchar(250) NULL,
	Telephone varchar(50) NULL,
	Area varchar(50) NULL,
	PhaseWire varchar(100) NULL,
	MaxLoad varchar(100) NULL,
	DelayTime varchar(50) NULL,
	AE varchar(50) NULL
GO
ALTER TABLE dbo.IC_SDJL SET (LOCK_ESCALATION = TABLE)
GO
COMMIT

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE dbo.Tmp_IC_SDJL
	(
	CustomerID nvarchar(20) NULL,
	MeterNO nvarchar(20) NULL,
	PE int NULL,
	UnitPrice nvarchar(50) NULL,
	TotalCost nvarchar(50) NULL,
	PETime datetime NULL,
	PETimes nvarchar(20) NULL,
	RE nvarchar(50) NULL,
	ME nvarchar(10) NULL,
	TotalConsume nvarchar(50) NULL,
	RemainSum nvarchar(8) NULL,
	ST nvarchar(10) NULL,
	CTime datetime NULL,
	Operator nvarchar(10) NULL,
	FClient varchar(50) NULL,
	UserName varchar(50) NULL,
	Address varchar(250) NULL,
	Telephone varchar(50) NULL,
	Area varchar(50) NULL,
	PhaseWire varchar(100) NULL,
	MaxLoad varchar(100) NULL,
	DelayTime varchar(50) NULL,
	AE varchar(50) NULL
	)  ON [PRIMARY]
GO
ALTER TABLE dbo.Tmp_IC_SDJL SET (LOCK_ESCALATION = TABLE)
GO
IF EXISTS(SELECT * FROM dbo.IC_SDJL)
	 EXEC('INSERT INTO dbo.Tmp_IC_SDJL (CustomerID, MeterNO, PE, UnitPrice, TotalCost, PETime, PETimes, RE, ME, TotalConsume, RemainSum, ST, CTime, Operator, FClient, UserName, Address, Telephone, Area, PhaseWire, MaxLoad, DelayTime, AE)
		SELECT CustomerID, MeterNO, PE, UnitPrice, TotalCost, PETime, PETimes, RE, ME, TotalConsume, RemainSum, ST, CTime, Operator, FClient, UserName, Address, Telephone, Area, PhaseWire, MaxLoad, DelayTime, AE FROM dbo.IC_SDJL WITH (HOLDLOCK TABLOCKX)')
GO
DROP TABLE dbo.IC_SDJL
GO
EXECUTE sp_rename N'dbo.Tmp_IC_SDJL', N'IC_SDJL', 'OBJECT' 
GO
COMMIT
